package com.ampaiva.pattern;

import java.util.ArrayList;
import java.util.List;

public class Child<P, T> extends ArrayList<T> {
    private static final long serialVersionUID = 6070309575398648011L;
    private final P parent;

    public Child(P parent) {
        this.parent = parent;
    }

    public Child(P parent, List<T> items) {
        this(parent);
        if (items == null)
            return;
        for (T item : items) {
            add(item);
        }
    }

    public P getParent() {
        return parent;
    }
}
